﻿@model TimerTask.Model.Common.Pager
<div class="row">
    <div class="col-sm-5">
        <div class="dataTables_info" role="status" aria-live="polite">当前 @Model.Index 页，共 @Model.TotalPage 页，共 @Model.TotalCount 项</div>
    </div>
    <div class="col-sm-7">
        <div class="dataTables_paginate paging_simple_numbers">
            <ul class="pagination">
                @if (Model.Index == 1)
                {
                    <li class="paginate_button previous disabled"  ><a href="#">上一页</a></li>
                }
                else
                {
                    <li class="paginate_button previous"  ><a href="#" onclick="loadPage(@(Model.Index-1))">上一页</a></li>
                }
                @for (int i = 1; i <= Model.TotalPage; i++)
                {
                    if (i == Model.Index)
                    {
                        <li class="paginate_button active"  ><a href="#">@i</a></li>
                    }
                    else
                    {
                        <li class="paginate_button"  ><a href="#" onclick="loadPage(@i)">@i</a></li>
                    }
                }
                @if (Model.Index == Model.TotalPage || Model.TotalPage == 0)
                {
                    <li class="paginate_button next disabled"  ><a href="#">下一页</a></li>
                }
                else
                {
                    <li class="paginate_button next"  ><a href="#" onclick="loadPage(@(Model.Index+1))">下一页</a></li>
                }

            </ul>
        </div>
    </div>
</div>